<template>
    <div class="chart_box">
        <CardTitle v-if="props.title" :title="props.title">
            <slot name="title"></slot>
        </CardTitle>
        <div class="content_box" v-loading="props.loading">
            <slot/>
        </div>
    </div>
</template>

<script setup>

    import CardTitle from './components/cardTitle'

    const props=defineProps({
        title: {
            type: String,
            default: () => ''
        },
        loading:{
            type: Boolean,
            default: () => false
        }
    })

</script>

<style scoped lang="less">
    .chart_box{
        display: flex;
        flex-direction: column;
        overflow: hidden;
        width: 100%;
        height: 100%;
        .content_box{
            flex: 1;
            overflow: hidden;
        }
    }
</style>